package org.example.servicelisten.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.model.manage.bean.po.CounselorMajor;
import org.example.model.manage.bean.po.Major;
import org.example.model.manage.bean.po.Student;
import org.example.model.manage.bean.po.security.User;
import org.example.model.manage.bean.vo.MajorCount;
import org.example.servicelisten.mapper.StudentMapper;
import org.example.servicelisten.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2025-07-16
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> getAllByMajorId(Integer majorId) {
        return studentMapper.selectList(new QueryWrapper<Student>().eq("major_id", majorId));
    }

    @Override
    public boolean updateReportStatus(Integer studentId, Integer reportCheck) {
        Student student = new Student();
        student.setId(studentId);
        student.setReportCheck(reportCheck);
        return this.updateById(student);
    }
}
